<script lang="ts" setup name="SuggestQuestion">
// 导入常量
import { KEY_WORDSLIST } from '../config/constant'

// 定义props
defineProps({
  list: {
    type: Array<string>,
    default: KEY_WORDSLIST
  }
})
</script>
<template>
  <div class="suggest-question">
    <!-- 标题 -->
    <div class="suggest-question__title">我猜想您想问如下问题</div>
    <!-- 内容 -->
    <div class="suggest-question__content">
      <!-- 遍历list -->
      <div
        class="suggest-question__item"
        v-for="(item, index) in list"
        :key="index"
        @click="$emit('onClick', item)"
      >
        {{ item }}
      </div>
    </div>
  </div>
</template>

<style lang="less" scoped>
.suggest-question {
  &__title {
    font-size: 12px;
    line-height: 44px;
    height: 44px;
    text-align: center;
    color: rgba(0, 0, 0, 0.6);
    border-bottom: 0.5px solid #e7e7e7ff;
    box-sizing: border-box;
  }

  &__content {
    padding: 0 16px;
  }

  &__item {
    display: flex;
    align-items: center;
    width: 100%;
    height: 48px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.9);

    &:not(:last-child) {
      border-bottom: 0.5px solid #e7e7e7ff;
    }
  }
}
</style>
